﻿using System;
using System.Collections.Generic;
using System.Text;
//using Microsoft.Office;
//using Microsoft.Office.Interop.Excel;


namespace LocalizationTest.Tools
{
  class ExcelViewer
  {
    public static void ViewWithExcel(double[,] array)
    {
    }
    /*
    public static void ViewWithExcel(double[,] array)
    {
      Microsoft.Office.Interop.Excel.Application xla;
      xla = new Microsoft.Office.Interop.Excel.Application();

      xla.Visible = true;
      Workbook wb = xla.Workbooks.Add(XlSheetType.xlWorksheet);
      Worksheet ws = (Worksheet)xla.ActiveSheet;

      // Now create the chart.
      ChartObjects chartObjs = (ChartObjects)ws.ChartObjects(Type.Missing);
      ChartObject chartObj = chartObjs.Add(100, 20, 300, 300);
      Chart xlChart = chartObj.Chart;

      int nRows = 25;
      int nColumns = 25;
      string upperLeftCell = "B3";
      int endRowNumber = System.Int32.Parse(upperLeftCell.Substring(1))
          + nRows - 1;
      char endColumnLetter = System.Convert.ToChar(
          Convert.ToInt32(upperLeftCell[0]) + nColumns - 1);
      string upperRightCell = System.String.Format("{0}{1}",
          endColumnLetter, System.Int32.Parse(upperLeftCell.Substring(1)));
      string lowerRightCell = System.String.Format("{0}{1}",
          endColumnLetter, endRowNumber);

      // Send single dimensional array to Excel:
      Range rg1 = ws.get_Range("B2", "Z2");
      double[] xarray = new double[nColumns];
      ws.Cells[1, 1] = "Data for surface chart";
      for (int i = 0; i < xarray.Length; i++)
      {
        xarray[i] = -3.0f + i * 0.25f;
        ws.Cells[i + 3, 1] = xarray[i];
        ws.Cells[2, 2 + i] = xarray[i];
      }

      object upperLeftData = ws.Cells[5, 5];
      object lowerLeftData = ws.Cells[5 + array.GetLength(0), array.GetLength(1)];

      Range rg = ws.get_Range(upperLeftData, lowerLeftData);
      rg.Value2 = AddData(array);

      Range chartRange = ws.get_Range(upperLeftData, lowerLeftData);
      xlChart.SetSourceData(chartRange, Type.Missing);
      xlChart.ChartType = XlChartType.xlSurface;

    }
*/
    /*
    private static double[,] AddData(double[,] dataArray)
    {
      double[] xarray = new double[dataArray.GetLength(0)];
      for (int i = 0; i < xarray.Length; i++)
      {
        xarray[i] = -3.0f + i * 0.25f;
      }
      double[] yarray = xarray;

      return dataArray;
    }
    */
  }
}

